<!DOCTYPE html>
<html lang="">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>notebook</title>

    <script src="../public/vue/dist/vue.min.js"></script>
    <!-- Bootstrap CSS -->
    <link href="../public/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
    <!-- jQuery -->
    <script src="../public/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap JavaScript -->
    <script src="../public/bootstrap/dist/js/bootstrap.min.js"></script>


    <link rel="stylesheet" href="../public/summernote/dist/summernote.css">
    <!-- <link rel="stylesheet" href="../public/summernote/dist/summernote-bs4.css"> -->

    <script src="../public/summernote/dist/summernote.js"></script>
    <script src="../public/summernote/dist/lang/summernote-zh-CN.js"></script>


    <link rel="stylesheet" href="../public/jstree/dist/themes/default/style.min.css">

    <script src="../public/jstree/dist/jstree.min.js"></script>
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.3/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>



    <div class="jumbotron">
        <div class="container">
           
            <p>jps -ml</p>
            <p>taskkill /pid 4732  /f /t</p>
          
        </div>
    </div>
    
    <div class="container" style="margin:20px auto;" id="cmdApp">

        
     

       
                <div class="panel panel-info">

                    <div class="panel-body">
                        <form  role="form">
                            <div class="form-group">
                                <label for="">cmd</label>
                                <textarea class="form-control" v-model="cmdForm.cmd" rows="5"></textarea>
                              </div>
                           
                            <button type="button" @click="fnCmd" class="btn btn-primary">Test it</button>
                        </form>

                    
                    </div>
                </div>
                <div class="panel panel-info">

                    <div class="panel-body">
                        <form  role="form">
                            <div class="form-group">
                                <label for="">result</label>
                                
                                <textarea readonly class="form-control" v-model="result" rows="7"></textarea>
                              </div>
                           
                        </form>

                    
                    </div>
                </div>



    </div>

</body>

</html>

<script>
    var vm = new Vue({
        el: '#cmdApp',
        data: {
          
            result: '',
            cmdForm: {
                cmd: 'jps -ml'
            }
        },
     
        methods: {

            fnCmd() {
                var _self = this;

            

                var postUrl = '../cmds';
                $.ajax({
                    // crossDomain: true,
                    type: "post",
                    url: postUrl,
                    data: _self.cmdForm,
                    dataType: "json",
                    success: function (response) {

                        _self.result = JSON.stringify(response, null , 2);

                    }
                });

            },


          
        },
        mounted: function () {

        }
    })
</script>